/*
 * Created: Author: Aléx Carvalho / Date: May 16, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-06-11 01:31:49 -0300 (Thu, 11 Jun 2015) $
 */
package com.cpm.view.zk.editors.indicator;

import com.cpm.entities.Indicator;
import com.cpm.view.zk.editors.EditorPanel;
import com.cpm.view.zk.field.FormatTextField;
import com.cpm.view.zk.field.TextField;

public class IndicatorGeneralPane extends EditorPanel<Indicator> {

    private final TextField nameField = new TextField();
    private final FormatTextField infoField = new FormatTextField();

    public IndicatorGeneralPane() {
        super("Geral");
        initComponents();
    }

    @Override
    protected void updatePanel() {
        nameField.setValue(clone.getName());
        infoField.setValue(clone.getInformation());
    }

    @Override
    protected void updateSource() {
        clone.setName(nameField.getValue());
        clone.setInformation(infoField.getInformation());
    }

    private void initComponents() {

        nameField.setLabel("Nome:");
        infoField.setLabel("Descrição:");

        addInputField(nameField, 1);
        addInputField(infoField, 2);

    }
}
